package com.eachonline.smart.service.imp;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.eachonline.mapper.GenericMapper;
import com.eachonline.service.GenericServiceImpl;
import com.eachonline.smart.mapper.SmartCommentMapper;
import com.eachonline.smart.model.SmartComment;
import com.eachonline.smart.model.SmartCommentExample;
import com.eachonline.smart.service.SmartCommentService;
@Service
public class SmartCommentServiceImp extends GenericServiceImpl< SmartComment,  SmartCommentExample, String> implements  SmartCommentService {

	@Autowired
	private  SmartCommentMapper   smartCommentMapper;

	@Override
	protected GenericMapper<SmartComment, SmartCommentExample, String> getGenericMapper() {
		// TODO Auto-generated method stub
		return this.smartCommentMapper;
	}

	@Override
	public int CountBusinessComments(String businessId) {
		// TODO Auto-generated method stub
		SmartCommentExample cExa=new SmartCommentExample();
		cExa.createCriteria().andBusinessIdEqualTo(businessId);
		return smartCommentMapper.countByExample(cExa);
		
	}
	
	
}